package com.angzh.bolibao.model;


import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;

@SuppressWarnings("serial")
public class Clicks extends Model<Clicks>{
	
	public static final  Clicks dao = new Clicks();
	
	public Record getClicks(String weichat,String startTime,String endTime){
		String sql = "";
		if(startTime!=null&&!startTime.equals("")){
			sql += " and createtime >= '"+startTime+" 00:00:00'";
		}
		if(endTime!=null && !endTime.equals("")){
			sql += " and createtime <= '"+endTime+" 23:59:59'";
		}
		Record clicks = Db.findFirst("select count(*) as count from clicks where openId='"+weichat+"' "+sql);
		return clicks;
	}
}
